home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
perlcl16.lha
/
perlclass1.6
/
sample
/
tstio.c++
< prev
Wrap
C/C++ Source or Header
|
1992-10-26
|
819b
|
50 lines
#include <fstream.h>
#include <strstream.h>
#include <stdlib.h>
#include "perlclass.h"
#include "perlassoc.h"
void main()
{
ifstream fin("t.txt");
ofstream fout("t2.txt");
PerlString s;
PerlStringList l;
while(fin >> s){
cout << "read in string: " << s << endl;
fout << s << endl;
}
fin.close();
fout.close();
fin.open("t.txt");
fin >> l;
cout << "List =" << endl << l << endl;
#if 1
strstream ss, iss;
ss << "one\n" << "two\nthree\nfour\n";
ss >> l;
cout << l << endl;
PerlList<int> il;
iss << 1 << " " << 2 << " " << 3 << " " << 4 << endl;
iss << "5 6 7 8 9" << endl;
iss >> il;
cout << il << endl;
#endif
cout << "Start Typing:" << endl;
while(cin >> s){
cout << "read in string: " << s << endl;
}
}